const BaseController = require("./base");

class Controller extends BaseController {
	constructor(...args) {
		super(...args);
		this.table = "perm";
		this.createRule = {
			name: "string",
			nickname: "string",
			menu_id: "string"
		};
		this.updateRule = this.createRule;
	}

	async getPermTree() {
		const { ctx, service } = this;
		const permTree = await service.perm.getPermTree();

		ctx.body = permTree;
	}
}

module.exports = Controller;
